<template>
	<view class="release">
		<view class="title" v-if="!isMylife">
			<span @click="$emit('toDraft')">我的草稿箱</span>
			<i class="iconfont" @click="$emit('closeDia')">&#xe607;</i>
		</view>
		<view class="listbox">
			<view class="list" @click="toPage('/pages/create/article')">
				<image src="../static/images/wenzhang.png" mode="widthFix"></image>
				<span>文章</span>
			</view>
			<view class="list" @click="toPage('/pages/create/picture')">
				<image src="../static/images/tuwen.png" mode="widthFix"></image>
				<span>图文</span>
			</view>
			<view class="list" @click="toPage('/pages/create/video')">
				<image src="../static/images/shiping.png" mode="widthFix"></image>
				<span>视频</span>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props:{
		isMylife:{
			type:Boolean,
			default:false
		}
	},
	data() {
		return {
			familyMemberId:'',
			familyId:''
		};
	},
	onLoad() {},
	methods: {
		init(familyMemberId,familyId){
			this.familyMemberId = familyMemberId
			
			this.familyId = familyId
			
			
			console.log(familyMemberId)
		},
		toPage(url){
			
			console.log(this.familyMemberId)
			if(this.isMylife){
				
				if(this.familyMemberId){
					uni.navigateTo({
						url:url+`?isMylife=1&familyMemberId=${this.familyMemberId}`
					})
				}else{
					uni.navigateTo({
						url:url+'?isMylife=1'
					})
				}
				
			}else{
				if(this.familyMemberId){
					uni.navigateTo({
						url:url+`?familyMemberId=${this.familyMemberId}&familyId=${this.familyId}`
					})
				}else{
					uni.navigateTo({
						url
					})
				}
				
				
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.release {
	background-color: #f8f8f8;
	border-radius: 20rpx;
	box-sizing: border-box;
	padding: 30rpx;
	padding-bottom: 50rpx;
	width: 400px;
	
	.title {
		height: 80rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 60rpx;
		font-size: 36rpx;
		font-weight: bold;
		span{
			cursor: pointer;
		}
		.iconfont {
			color: #000;
			cursor: pointer;
		}
	}
	.listbox {
		background-color: #fff;
		padding: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-radius: 10rpx;
		.list {
			display: flex;
			align-items: center;
			justify-content: center;
			cursor: pointer;
			font-size: 32rpx;
			image {
				width: 50rpx;
				margin-right: 20rpx;
			}
		}
	}
}
</style>
